import numpy as np 
import pandas as pd 
import matplotlib.pyplot as plt 
plt.rcParams.update({'font.size': 8.9})
plt.rcParams.update({'font.weight': 'heavy'})
plt.rcParams.update({'axes.titleweight': 'heavy'})
plt.rcParams.update({'axes.labelweight': 'heavy'})
plt.rcParams.update({'figure.dpi': 200}) 

#set directory
#df1 = pd.read_excel('AbandondedDataNoTotals_allQartersCombined.xlsx', '2016-2020Q3')
df1 = pd.read_excel('FilingDate_DataNoTotals_allQartersCombined.xlsx')

listOfTechCenters = ['TC1600 BioTech & O Chem',
					 'TC1700 Chem & Materials Eng',
					 'TC2100 Computer Architecture',
					 'TC2400 Computer Networks',
					 'TC2600 Communications',
					 'TC2800 Semiconductors',
					 'TC2900 Design',
					 'TC3600 Transport/Construction/ECom',
					 'TC3700 Mech Eng & Med Devices',
					 'TC3900 REexam/Abandonments',
					 'tcOther']

months = ['Jan',
		  'Feb',
		  'Mar',
		  'Apr',
		  'May',
		  'Jun',
		  'Jul',
		  'Aug',
		  'Sept',
		  'Oct',
		  'Nov']

listOfQuarters = ['2016-Q1', '2016-Q2', '2016-Q3', '2016-Q4', 
				  '2017-Q1', '2017-Q2', '2017-Q3', '2017-Q4',
				  '2018-Q1', '2018-Q2', '2018-Q3', '2018-Q4',
				  '2019-Q1', '2019-Q2', '2019-Q3', '2019-Q4',
				  '2020-Q1', '2020-Q2', '2020-Q3']#'2020-Q4']

# listOfQuarters = ['2018-Q1', '2018-Q2', '2018-Q3', '2018-Q4',
# 				  '2019-Q1', '2019-Q2', '2019-Q3', '2019-Q4',
# 				  '2020-Q1', '2020-Q2', '2020-Q3']#'2020-Q4']



plt.style.use('seaborn-whitegrid')

plt.plot(df1['TC1600'], label=listOfTechCenters[0])
plt.plot(df1['TC1700'], label=listOfTechCenters[1])
plt.plot(df1['TC2100'], label=listOfTechCenters[2])
plt.plot(df1['TC2400'], label=listOfTechCenters[3])
plt.plot(df1['TC2600'], label=listOfTechCenters[4])
plt.plot(df1['TC2800'], label=listOfTechCenters[5])
plt.plot(df1['TC3600'], label=listOfTechCenters[7])
plt.plot(df1['TC3700'], label=listOfTechCenters[8])


plt.xticks(np.arange(19), listOfQuarters, rotation=60)
#plt.xticks(np.arange(11), months, rotation=60)

plt.title('Filed New Applications by Tech Center')

plt.xlabel('Years in Quarters')
#plt.xlabel('2020')

plt.ylabel('Number of Applications')

plt.grid(True, color='k', linestyle=':')

plt.legend(frameon=True, framealpha=1, bbox_to_anchor=(1.06,1.1))

plt.show()

print(plt.style.available)